<?php
include_once('header.php');

// IF INPUTING KEYWORDS
if (isset($_POST['keyword']) && !empty($_POST['keyword']))
{
	$keyword = $_POST['keyword'];
	$keyword = trim($keyword);
	$keyword = strtolower($keyword);
	
	// save this keyword stats
	include_once LIBRARY_DIRECTORY . 'GoogleSearch.php';
	$googleSearch = new GoogleSearch($keyword);
	$googleSearch->saveKeyword();
	
	// reidrect to this page to avoid F5 key problem
	header("Location: input_keyword.php");
}

$SMARTY->display('input_keyword.tpl');